home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1985 Winter
/
rerun-1985-winter.d64
/
pay the bills
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
5KB
|
199 lines
100 rem <<< check writer >>>
110 rem wayne arnett
120 rem
130 print chr$(142)
140 f1$=chr$(133):f7$=chr$(136):rem key 1,f1$:key 7,f7$
150 dim c$(24,3),c(24):rem checks
160 dim d$(5,2),d(5):rem deposits
170 dim w$(5):rem numerals/words
180 dim m$(12):rem months
190 dim a1$(19),a2$(9)
200 for i=1to19:read a1$(i):next
210 for i=2to9:read a2$(i):next
220 for i=1to12:read m$(i):next
230 for i=1to5:for j=1to3 step2
240 read c$(i,j):nextj,i
250 rem
260 data one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve
270 data thirteen,fourteen,fifteen,sixteen,seventeen,eighteen,nineteen
280 rem
290 data twenty,thirty,forty,fifty,sixty,seventy,eighty,ninety
300 rem
310 data jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec
320 rem
330 data mortgage company,"account #"
340 data electric company,"account #"
350 data water company,"account #"
360 data gas credit card,"account #"
370 data mastercharge,"account #"
380 rem **
390 rem *** initial format
400 rem **
410 print"[147]enter information for checks & register":print
420 input "month (1-12)";mo
430 input "day (1-31)";da$
440 input "two-digit year";yr$
450 dy$=m$(mo)+" "+da$+" "+yr$
460 dz$=m$(mo)+" "+da$+", 19"+yr$
470 print:input"how many deposits (max 5)";nd
480 if nd>5 then470
490 if nd=0 then print:goto580
500 for i=1to nd
510 print:input"date (mmdd)";dt$
520 if len(dt$)<>4 then510
530 d$(i,1)=left$(dt$,2)+"/"+right$(dt$,2)
540 input "amount ";d(i):rem 5 spcs
550 td=td+d(i)
560 g=d(i):gosub1750:d$(i,2)=g$
570 nexti:print"[147]"
580 g=td:gosub1750:td$=g$
590 input"beginning balance";bb
600 g=bb:gosub1750:bb$=g$
610 print:input"bank charges";bc
620 g=bc:gosub1750:bc$=g$
630 print:input"other deductions";od
640 g=od:gosub1750:od$=g$
650 print:input"first check number";fcn
660 rem **
670 rem *** set up checks
680 rem **
690 print"[147]enter information for printing checks."
700 print"to skip one, hit 'return' without"
710 print"entering any numbers."
720 cn=fcn:rc=1
730 for i=1to5
740 print:print " check no.";cn;"[157] "
750 print"payee: ";c$(i,1)
760 input"amount ";c(i)
770 if c(i)<1 then800
780 if c(i)>=10000 then760
790 gosub890:cn=cn+1
800 nc=nc+1:nexti
810 rc=0
820 print"[147]after writing last check, hit 'return'"
830 print"without an entry for payee."
840 print:print " check no.";cn;"[157] "
850 input"payee ";c$(i,1)
860 if c$(i,1)=""then980
870 input"amount";c(i)
880 if c(i)<1 or c(i)>=10000 then870
890 tc=tc+c(i)
900 g=c(i):gosub1750:c$(i,2)=g$
910 if rc then return
920 input"memo ";c$(i,3)
930 if len(c$(i,3))>20 then920
940 i=i+1:cn=cn+1:nc=nc+1
950 if i>24 then980
960 k=i-6:if k/4=int(k/4)then print"[147]"
970 goto840
980 g=tc:gosub1750:tc$=g$
990 eb=bb+td-bc-od-tc
1000 g=eb:gosub1750:eb$=g$
1010 rem **
1020 rem *** print checks
1030 rem **
1040 print"[147]be sure the asterisks were printed at"
1050 print"top of first check. press f1 to proceed"
1060 print"with printing. f7 to try again."
1070 close3:cn=fcn:open3,4
1080 print#3,"*****"
1090 get r$:if r$="" then1090
1100 if r$=f1$ then1130
1110 if r$=f7$ then1080
1120 goto1090
1130 sp=2:gosub1780
1140 for i=1 to nc
1150 if c(i)<1 then1320
1160 print#3,tab(55);"#";cn
1170 sp=1:gosub1780
1180 print#3,tab(55)dy$
1190 c$(i,1)=left$(c$(i,1),44)
1200 for j=1 to 45-len(c$(i,1))
1210 c$(i,1)=c$(i,1)+" ":nextj
1220 sp=4:gosub1780
1230 print#3,tab(6);c$(i,1);
1240 print#3,tab(10);c$(i,2)
1250 sp=2:gosub1780
1260 gosub1810
1270 print#3,tab(6);w$
1280 sp=4:gosub1780
1290 print#3,tab(6);c$(i,3)
1300 sp=5:gosub1780
1310 cn=cn+1
1320 nexti
1330 close3
1340 rem **
1350 rem *** print register
1360 rem **
1370 print"[147] to print a summary for your records,"
1380 print" install regular paper in printer."
1390 print:print tab(13);"f1 to print"
1400 print tab(9);"f7 to exit program"
1410 get r$:if r$=""then1410
1420 if r$=f1$ then1450
1430 if r$=f7$ then2030
1440 goto1410
1450 open3,4
1460 print#3,chr$(14);tab(11)"checking account"
1470 print#3,tab(13);dz$;chr$(15)
1480 print#3:print#3
1490 print#3,"beginning balance";tab(50-len(bb$));bb$
1500 print#3
1510 if nd=0 then1550
1520 fori=1to nd
1530 print#3,"deposit ";d$(i,1);tab(54-len(d$(i,2)));d$(i,2)
1540 nexti
1550 print#3
1560 print#3,"less bank charges";tab(29-len(bc$));bc$
1570 if od=0 then1590
1580 print#3:print#3,"other deductions";tab(30-len(od$));od$
1590 print#3:cn=fcn
1600 for i=1to nc
1610 if c(i)<1 then1670
1620 c$(i,1)=left$(c$(i,1),30)
1630 if cn>999 then k=7:goto1650
1640 k=8
1650 print#3,"ck#";cn;c$(i,1);tab(k-len(c$(i,2)));c$(i,2)
1660 cn=cn+1
1670 next i
1680 print#3:print#3,"*** total checks ***";tab(26-len(tc$));tc$
1690 print#3:print#3,"ending balance";tab(53-len(eb$));eb$
1700 close3:goto2030
1710 rem **
1720 rem *** subroutines
1730 rem **
1740 rem----align decimal points
1750 g$=str$(int(g))+"."+right$(str$(g*100),2)
1760 return
1770 rem----set spacing for printout
1780 for n=1 to sp:print#3:nextn
1790 return
1800 rem----convert numbers to words
1810 for j=1to5:w$(j)="":nextj
1820 q$=c$(i,2):l1=(len(q$))-1
1830 q$=right$(q$,l1):l2=l1-3
1840 ca$=mid$(q$,1,l2):ce$=right$(q$,2)
1850 m=1:on l2 goto1920,1910,1880,1860
1860 t=val(mid$(ca$,m,1))
1870 w$(1)=a1$(t)+" thousand ":m=m+1
1880 t=val(mid$(ca$,m,1)):if t=0 then1900
1890 w$(2)=a1$(t)+" hundred "
1900 m=m+1
1910 t1=val(mid$(ca$,m,1)):m=m+1
1920 t2=val(mid$(ca$,m,1))
1930 if t1=0 then1960
1940 if t1=1 then t3=10+t2:w$(5)=a1$(t3):goto1990
1950 w$(3)=a2$(t1)
1960 if t2=0 then w$(5)=w$(3):goto1990
1970 w$(4)=a1$(t2):if t1=0 then w$(5)=w$(4):goto1990
1980 w$(5)=w$(3)+"-"+w$(4)
1990 w$=w$(1)+w$(2)+w$(5)+" and "+ce$+"/100"
2000 w$="*** "+w$+" ***"
2010 t=0:t1=0:t2=0
2020 return
2030 end
5000 input "enter #";c
5010 if int(100*c)<>100*c then5000
5020 printc,100*c
5030 goto5000